<?php 
$companyid=$session->read("companyid");
$user=$session->read('User');
$isflag=$action->checkPermissions($user,$companyid);
?>
<?php echo $javascript->link('jquery.timelinr-0.9.4.js');?>
<script type="text/javascript">
	$(function(){
		$().timelinr({
			orientation: 'horizontal',
			containerDiv: '#timeline',
			datesDiv: '#dates',
			datesSelectedClass: 'selected',
			datesSpeed: 500,
			issuesDiv : '#issues',
			issuesSelectedClass: 'selected',
			issuesSpeed: 200,
			issuesTransparency: 0.2,
			issuesTransparencySpeed: 500,
			prevButton: '#prev',
			nextButton: '#next',
			arrowKeys: 'false',
			startAt: 1,
			autoPlay: 'false',
			autoPlayDirection: 'forward',
			autoPlayPause: 2000
	 	});
	});
</script>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2>
		<?php 
		$companyname=$session->read("companyname");
		echo $html->link($companyname,"/companys/showinfosummary/".$companyid);
		?>
    	</h2>
		<div class="clear"></div>
	</div>
	<?php 
		if($isflag){
    		echo '<div class="right item_add_btn">';
			echo $html->link(__('添加',true), 'edittechnology');
			echo '</div>';
		}else{
			echo '<div class="right enableaction">';
			echo "<a>添加</a>";
			echo '</div>';
		}
	?>
	<?php
    $cuser=$session->read('User'); 
	?>
    <div class="clear"></div>
    
    <div class="right_sidt_head_screen">
    	<div class="left">
		    <div class="right_side_head_line">
				<ul>
					<li>
						<div class="left screen_condition"><?php echo $html->link("立项总数","/companys/technology/")?>：</div>
						<div class="left screen_counts"><?php echo $urlcount?>个</div>
						<div class="clear"></div>
					</li>
					<div class="clear"></div>
				</ul>
			</div>
		</div>
		<div class="right display_by_year_btn"><?php echo $html->link('返回',"/companys/technology/",null,null); ?></div>
		<div class="clear"></div>
	</div>
    
</div>
<div class="right_side_scollbar">
	<div class="detail_info_panel">
        <div class="time_line_panel" id='time_panel'>
        	<div class="time_line_area" id="timeline">
            	<ul id="dates">
            	 	<?php if($year_time){
            	 		foreach($year_time as $y){           	 		
            	 	?>
            	 		<li><a href="#<?php echo $y; ?>"><?php echo $y; ?></a></li>
            	 	<?php
            	 	 }
            	  }
            	  ?>
                </ul>
                <ul id="issues">
                	
                	<?php foreach($year_time as $y){ 
                   						 $i = 0; //总
						                $j = 0;$p = 0;
						                $k = 0;$m = 0;
						                $h = 0;$n = 0;$l=0;
                    ?>
                    <li id="<?php echo $y; ?>">
                        <div class="issue_details">
                        	<div class="right_sidt_screen_by_year">
                        	  <div class="right_side_head_line">
                        	     <div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					本年度总立项数：
                        				</div>
                        				<div id='allyeartechnologies<?php echo $y; ?>' class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					软件产品：
                        				</div>
                        				<div id="soft_product<?php echo $y; ?>" class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					软件企业：
                        				</div>
                        				<div id="soft_company<?php echo $y; ?>" class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					高新产品：
                        				</div>
                        				<div id="high_product<?php echo $y; ?>" class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					高新企业：
                        				</div>
                        				<div id="high_company<?php echo $y; ?>" class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="clear"></div>
                        		</div>
                        		<div class="right_side_head_line">
                        			<div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					申请中：
                        				</div>
                        				<div id="application<?php echo $y ;?>" class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					已受理：
                        				</div>
                        				<div id="accept<?php echo $y ;?>" class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="left per_screen_by_time">
                        				<div class="left screen_condition">
                        					已授权：
                        				</div>
                        				<div id="authorized<?php echo $y ;?>" class="left screen_counts"></div>
                        				<div class="clear"></div>
                        			</div>
                        			<div class="clear"></div>
                        		</div>   
                        		          		
                        	  	<div class="items_list" id='panel'>
						        	<table>
						            	<tr>
						            		<th>名称</th>
						            		<th>立项类型</th>
						            		<th>立项状态</th>
						            		<th>时间</th>               					
						                    <th><?php __("Action")?></th>
						                </tr>
						                 <?php 

					                    $cuser=$session->read('User');
						                
										foreach($timetechnology[$y] as $technology){
											$id=$technology["CompTechnology"]["id"];
											echo "<tr class='per_list'>";
											echo "<td>".$html->link($technology['CompTechnology']['tname'],"/companys/showtechnology/".$id)."</td>";
											echo "<td>".$technology['type_id']['value']."</td>";
											if($technology['type_id']['value'] == '软件产品'){
												$j++;
											}elseif($technology['type_id']['value'] == '软件企业'){
												$k++;
											}elseif($technology['type_id']['value'] == '高新产品'){
												$h++;
											}elseif($technology['type_id']['value'] == '高新企业'){
												$p++;
											}
											$value = $technology['CompTechnology']['state'];
											echo "<td>".$str->getstaus($value)."</td>";
											if($value == '0'){
												$m++;
											}elseif($value == '1'){
												$n++;
											}elseif($value == '2'){
												$l++;
											}																					
											$apply_time=$technology["CompTechnology"]["apply_time"];
											$accept_time=$technology["CompTechnology"]["accept_time"];
											$authorize_time=$technology["CompTechnology"]["authorize_time"];
											echo "<td>".$str->getstaustime($value, $apply_time, $accept_time, $authorize_time)."</td>";
											echo "<td>";
											if($isflag){
												echo $html->link(__("Edit",true),"/companys/edittechnology/".$id,null,null);
												echo $html->link(__("Delete",true),"/companys/deltechnology/".$id,array("onclick"=>"return doaction(this)"));
											}else{
												echo "<span class='enableaction'>编辑</span>";
												echo "<span class='enableaction'>删除</span>";
											}
											echo "</td>";
											echo "</tr>";
										}?>
						            </table>
						      	</div>
							</div>
                    </li>
                     <script>
                    	$("#allyeartechnologies<?php echo $y;?>").html('<?php echo $i; ?>个');
                    	$("#soft_product<?php echo $y;?>").html('<?php echo $j; ?>个');
                    	$("#soft_company<?php echo $y;?>").html('<?php echo $h; ?>个');
                    	$("#high_product<?php echo $y;?>").html('<?php echo $k; ?>个');
                    	$("#high_company<?php echo $y;?>").html('<?php echo $p; ?>个');
                    	$("#application<?php echo $y;?>").html('<?php echo $m; ?>个');
                    	$("#accept<?php echo $y;?>").html('<?php echo $n; ?>个');
                    	$("#authorized<?php echo $y;?>").html('<?php echo $l; ?>个');
					</script>
                    <?php } ?>                   
                </ul>
                <div id="issue_panel_arrow"></div>
                <div id="grad_left"></div>
				<div id="grad_right"></div>
                <a href="#" id="next">+</a>
                <a href="#" id="prev">-</a>
            </div>
        </div>
    </div>
</div>
<?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>
